load("@rules_rust//rust:defs.bzl", "rust_doc", "rust_doc_test", "rust_library", "rust_test", "rust_test_suite")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:hpke",
]

MACRO_DEPENDENCIES = []

DEV_DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:hex",
    "@crate_index//:rand",
    "@crate_index//:rand_chacha",
]

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "ic-hpke",
    srcs = glob(["src/**/*.rs"]),
    aliases = ALIASES,
    crate_name = "ic_hpke",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.1.0",
    deps = DEPENDENCIES,
)

rust_doc(
    name = "doc",
    crate = ":ic-hpke",
)

rust_doc_test(
    name = "doc_test",
    crate = ":ic-hpke",
    deps = [":ic-hpke"] + DEPENDENCIES + DEV_DEPENDENCIES,
)

rust_test(
    name = "test",
    aliases = ALIASES,
    crate = ":ic-hpke",
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)

rust_test_suite(
    name = "integration_tests",
    srcs = glob(["tests/**/*.rs"]),
    aliases = ALIASES,
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = [":ic-hpke"] + DEPENDENCIES + DEV_DEPENDENCIES,
)
